package com.uchiha.nova.core.feign;

import com.uchiha.nova.core.tool.constant.ApplicationConstant;
import com.uchiha.nova.core.tool.constant.NovaCRUDMethodConstant;
import com.uchiha.nova.core.model.dto.RoleDTO;
import com.uchiha.nova.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 角色管理 Feign接口
 *
 * @author magic
 */
@FeignClient(value = ApplicationConstant.AUTH,configuration= FeignConfiguration.class)
public interface RoleFeignService {
    String BASE = "/role";
    /**
     *详情
     */
    @PostMapping(BASE+ NovaCRUDMethodConstant.NOVA_DETAIL)
    R detail(@RequestBody RoleDTO roleDTO);
    /**
     *列表搜索
     */
    @GetMapping(BASE+ NovaCRUDMethodConstant.NOVA_LIST)
    R getPage(@RequestParam Map<String,Object> map);
    /**
     *新增
     */
    @PostMapping(BASE+ NovaCRUDMethodConstant.NOVA_SAVE)
    R save(@RequestBody RoleDTO roleDTO);
    /**
     *修改
     */
    @PostMapping(BASE+ NovaCRUDMethodConstant.NOVA_UPDATE)
    R update(@RequestBody RoleDTO roleDTO);
    /**
     *新增或者修改
     */
    @PostMapping(BASE+ NovaCRUDMethodConstant.NOVA_SAVEORUPDATE)
    R saveOrUpdate(@RequestBody RoleDTO roleDTO);
    /**
     *逻辑删除
     */
    @PostMapping(BASE+ NovaCRUDMethodConstant.NOVA_REMOVE)
    R remove(@RequestParam String ids);
    /**
     *物理删除
     */
    @DeleteMapping(BASE+ NovaCRUDMethodConstant.NOVA_DELETE)
    R delete(@RequestParam String ids);

    @PostMapping(BASE+"/getList")
    R getList(@RequestBody RoleDTO roleDTO);
}
